filechooser: Fix fallout from GtkText
authorMatthias Clasen <mclasen@redhat.com>
Sat, 27 Mar 2021 13:54:20 +0000 (09:54 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 27 Mar 2021 13:54:20 +0000 (09:54 -0400)
Ever since the GtkText split, the focus is no longer
on an entry, but inside it. The filechooser was never
updated for that.

gtk/gtkfilechooserwidget.c

index a666d55ca1d090c08360adf8c76a5c78e534356f..0349a4f6ca54af0189242dbd2585c1371810ddc8 100644 (file)
@@ -5444,7 +5444,9 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
       if (info.result == NULL && impl->location_entry)
         goto file_entry;
     }
-  else if (impl->location_entry && current_focus == impl->location_entry)
+  else if (impl->location_entry &&
+           (current_focus == impl->location_entry ||
+            gtk_widget_is_ancestor (current_focus, impl->location_entry)))
     {
       gboolean is_well_formed, is_empty, is_file_part_empty, is_folder;
 
@@ -6230,7 +6232,9 @@ gtk_file_chooser_widget_should_respond (GtkFileChooserWidget *impl)
           g_assert_not_reached ();
         }
     }
-  else if ((impl->location_entry != NULL) && (current_focus == impl->location_entry))
+  else if ((impl->location_entry != NULL) &&
+           (current_focus == impl->location_entry ||
+            gtk_widget_is_ancestor (current_focus, impl->location_entry)))
     {
       GFile *file;
       gboolean is_well_formed, is_empty, is_file_part_empty;